test(s3): keep XML test stream blocking#212
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a Windows CI regression in the S3 client XML test helper by ensuring accepted TCP connections are put back into blocking mode before applying timeouts and reading the HTTP request. This aligns the test server behavior across platforms and prevents WouldBlock read failures on windows-latest.
Changes:
- After
TcpListener::accept, explicitly set the acceptedTcpStreamto blocking mode (set_nonblocking(false)). - Keep the existing read timeout and request parsing logic unchanged, but now reliably reachable on Windows.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
No issue. Fixes a recent CI regression on
windows-latest.Evidence / reproduction
The CI run for
fix(ci): align protected file checks (#208)failed inTest (windows-latest)while runningcargo test --workspace. The failing test wasclient::tests::custom_headers_are_added_to_xml_requests_before_signing, where the local XML test server hit a request-read failure and the client reported a send failure.Root cause
The XML test helper sets the listener to nonblocking while waiting for a request. On Windows, the accepted
TcpStreamcan still behave as nonblocking, so the immediate request read can fail withWouldBlock.Fix
After accepting the request stream, explicitly switch it back to blocking mode before applying the read timeout and parsing the request.
Validation
cargo test -p rc-s3 custom_headers_are_added_to_xml_requests_before_signing --libcargo test -p rc-s3 --libcargo fmt --all --checkcargo clippy -p rc-s3 --all-targets -- -D warningsgit diff --checkmake pre-commit